'use strict';

/* Services */


// Demonstrate how to register services
// In this case it is a simple value service.
angular.module('nexus.services', []).
  value('version', '0.1');

angular.module('loginModule', []).factory('facebookService', function() {
    return new function() {
        this.askFacebookForAuthentication = function(fail, success) {
            FB.login(function(response) {
                if (response.authResponse) {
                    FB.api('/me', success);
                } else {
                    fail('User cancelled login or did not fully authorize.');
                }
            });
        }
    }
});
